package com.amit.jsp;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

public class JlcForTag  extends TagSupport
{
private int var;
private int i;

public void setVar(int var) {
	this.var = var;
}


@Override
	public int doStartTag() throws JspException {
		
	   i=0;
	   if(i<var)
	   {
		   return EVAL_BODY_INCLUDE;
	   }
	
	   else
	   {
		   return SKIP_BODY;
	   }
	
	}

@Override
	public int doAfterBody() throws JspException {
		
	
	i++;
	if(i<var)
	{
		return EVAL_BODY_AGAIN;
	}
	else
	{
		return SKIP_BODY;
	}
		
	}

	
}
